package cn.java63.printer2.printer;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class Printer {
    @Value("惠普系列")
    private String name;
    @Value("1999")
    private int price;
    @Resource
    private Ink ink;
    @Resource(name = "a4")
    private Page page;

    public void print(String s){
        System.out.println("价格为"+price+"元的"+name+"正在打印：");
        System.out.println("使用墨水是"+ink.getColor());
        page.print(s);
    }
}
